import java.util.Scanner;

public class Test {
    public static void main(String[] args) {

        Bank bank = new Bank("张三","123");
        bank.setBalance(100);

        while(true){
            Scanner scanner = new Scanner(System.in);
            System.out.println("请输入办理的业务");
            System.out.println("0.退出");
            System.out.println("1.取款");
            System.out.println("2.存款");
            System.out.println("3.查看余额");

            int key = scanner.nextInt();

            switch (key){
                case 0:System.exit(0);break;
                case 1:{
                    System.out.println("请输入密码");
                    String pw = scanner.next();
                    System.out.println("请输入取款金额");
                    double trade = scanner.nextDouble();
                    bank.draw(pw,trade);
                }break;
                case 2:{
                    System.out.println("请输入存款金额");
                    double trade = scanner.nextDouble();
                    bank.save(trade);
                }break;
                case 3:
                    System.out.println("账号余额：" + bank.getBalance());
            }
        }

    }
}